package cn.chrilwe.pigpig.core.model.user;

import java.util.Date;

import cn.chrilwe.autocreatetable.start.annotation.Entity;
import cn.chrilwe.autocreatetable.start.annotation.mysql.AutoIncrement;
import cn.chrilwe.autocreatetable.start.annotation.mysql.Column;
import cn.chrilwe.autocreatetable.start.annotation.mysql.Notnull;
import cn.chrilwe.autocreatetable.start.annotation.mysql.Primary;
import cn.chrilwe.autocreatetable.start.annotation.mysql.Table;
import cn.chrilwe.autocreatetable.start.common.Engine;
import cn.chrilwe.autocreatetable.start.common.MysqlColumnType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

/**
 * 
 * @author chrilwe
 * 2020-7-30
 */
@Data
@ToString
@ApiModel
@Entity
@Table(charset = "utf8", engine = Engine.INNODB, name = "tb_user")
public class User {
	
	@ApiModelProperty(name = "id", value = "用户id")
	@Column(length = 8, name = "id", type = MysqlColumnType.INT)
	@Primary
	@Notnull
	@AutoIncrement
	private int id;
	
	@ApiModelProperty(name = "username", value = "用户账号")
	@Column(length = 11, name = "username", type = MysqlColumnType.VARCHAR)
	@Notnull
	private String username;
	
	@ApiModelProperty(name = "password", value = "用户密码")
	@Column(length = 11, name = "password", type = MysqlColumnType.VARCHAR)
	@Notnull
	private String password;
	
	@ApiModelProperty(name = "nickName", value = "用户昵称")
	@Column(length = 11, name = "nick_name", type = MysqlColumnType.VARCHAR)
	private String nickName;
	
	@ApiModelProperty(name = "gender", value = "用户性别")
	@Column(length = 1, name = "gender", type = MysqlColumnType.INT)
	@Notnull
	private int gender;// 0:男 1:女
	
	@ApiModelProperty(name = "level", value = "用户等级")
	@Column(length = 3, name = "level", type = MysqlColumnType.INT)
	@Notnull
	private int level;
	
	@ApiModelProperty(name = "status", value = "用户账号状态")
	@Column(length = 1, name = "status", type = MysqlColumnType.INT)
	@Notnull
	private int status;// 0:异常 1:正常
	
	@ApiModelProperty(name = "createTime", value = "用户注册日期")
	@Column(length = 20, name = "create_time", type = MysqlColumnType.DATETIME)
	@Notnull
	private Date createTime;
	
	@ApiModelProperty(name = "phone", value = "用户手机号")
	@Column(length = 11, name = "phone", type = MysqlColumnType.VARCHAR)
	private String phone;
	
	@ApiModelProperty(name = "email", value = "用户邮箱")
	@Column(length = 30, name = "email", type = MysqlColumnType.VARCHAR)
	private String email;
	
	@ApiModelProperty(name = "birthday", value = "用户生日")
	@Column(length = 11, name = "birthday", type = MysqlColumnType.DATETIME)
	private Date birthday;
	
	@ApiModelProperty(name = "address", value = "用户地址")
	@Column(length = 150, name = "address", type = MysqlColumnType.VARCHAR)
	private String address;
	
	@ApiModelProperty(name = "userImage", value = "用户头像地址")
	@Column(length = 150, name = "user_image", type = MysqlColumnType.VARCHAR)
	private String userImage;
}
